Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for major/minor protocol version routing #443

Merged
merged 45 commits into from
Apr 17, 2020

Conversation

nrempel
Copy link
Contributor

@nrempel nrempel commented Apr 2, 2020

Addresses: #409, hyperledger/aries-rfcs#407

This pull requests major/minor version routing for aries protocols.

The implementation follows these rules:

  • Existing protocols (internal and external) should still work. This work is designed to not introduce any breaking changes.
  • If a protocol uses the old style, it can't receive other minor version messages. For them, the @type parameter must match exactly
  • New protocols must include a top level definition module and include references to protocol implementation as children.
  • There can only be any number of major version implementations per protocol. Each major version protocol is effectively treated as a separate protocol and is referenced by the definition module.
  • There can only be one minor version implementation per protocol major version.
  • Minimum minor version can be specified in definition.py. If a message is received for a protocol and major version with a minor version less than the minimum supported version, the agent will respond with a problem report with text describing the violation.
  • Any extra fields are now ignored when deserializing any agent messages. This ensures that protocols can support minor versions greater than the current implementation.

Remaining todo:

  • Documentation page on creating a new protocol
  • Even more manual testing?

Docs: https://github.com/nrempel/aries-cloudagent-python/blob/proto-versions/aries_cloudagent/protocols/README.md

nrempel added 30 commits March 19, 2020 09:22
Signed-off-by: Nicholas Rempel <[email protected]>
Signed-off-by: Nicholas Rempel <[email protected]>
Signed-off-by: Nicholas Rempel <[email protected]>
Signed-off-by: Nicholas Rempel <[email protected]>
Signed-off-by: Nicholas Rempel <[email protected]>
Signed-off-by: Nicholas Rempel <[email protected]>
Signed-off-by: Nicholas Rempel <[email protected]>
Signed-off-by: Nicholas Rempel <[email protected]>
Signed-off-by: Nicholas Rempel <[email protected]>
Signed-off-by: Nicholas Rempel <[email protected]>
Signed-off-by: Nicholas Rempel <[email protected]>
Signed-off-by: Nicholas Rempel <[email protected]>
@nrempel nrempel requested a review from andrewwhitehead April 2, 2020 21:11
@codecov-io
Copy link

codecov-io commented Apr 2, 2020

Codecov Report

Merging #443 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #443   +/-   ##
=======================================
  Coverage   93.74%   93.74%           
=======================================
  Files         235      235           
  Lines       11732    11732           
=======================================
  Hits        10998    10998           
  Misses        734      734           

@lgtm-com
Copy link

lgtm-com bot commented Apr 2, 2020

This pull request introduces 2 alerts when merging 9981c42 into 109ec34 - view on LGTM.com

new alerts:

  • 1 for Nested loops with same variable
  • 1 for Nested loops with same variable reused after inner loop body

@nrempel nrempel requested a review from swcurran April 2, 2020 21:28
@swcurran
Copy link
Contributor

swcurran commented Apr 2, 2020

@nrempel - curious about this constraint "If a protocol uses the old style, it can't receive other minor version messages. For them, the @type parameter must match exactly". By old style, I assume you mean "did:sov:...". Not that I think it's a particular issue, but wondering why that was added?

@nrempel
Copy link
Contributor Author

nrempel commented Apr 2, 2020

@nrempel - curious about this constraint "If a protocol uses the old style, it can't receive other minor version messages. For them, the @type parameter must match exactly". By old style, I assume you mean "did:sov:...". Not that I think it's a particular issue, but wondering why that was added?

In this context by old style I mean the structure of the protocol directory. If it doesn't define it's supported major version and minimum minor version, it uses the current functionality of an exact match. Basically, it's for backwards compatibility since that is the current behaviour.

Signed-off-by: Nicholas Rempel <[email protected]>
@nrempel
Copy link
Contributor Author

nrempel commented Apr 2, 2020

@TelegramSam do you have an opinion on these changes at all? I know you've been active in the spec discussion.

@nrempel nrempel marked this pull request as ready for review April 16, 2020 17:28
@nrempel
Copy link
Contributor Author

nrempel commented Apr 16, 2020

@andrewwhitehead I've opened up this PR

@andrewwhitehead
Copy link
Contributor

Added a couple comments but it looks good otherwise

@nrempel
Copy link
Contributor Author

nrempel commented Apr 17, 2020

@andrewwhitehead thanks, fixed

@andrewwhitehead andrewwhitehead merged commit cc7cb35 into openwallet-foundation:master Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants